<form action="" method="post" enctype="multipart/form-data">

		<div>
			<p><label>Add image (size: <?=$s[w]?> x <?=$s[h]?>)<br />
				<input type="file" name="image" class="wide" />
			</label></p>
			<p><input type="submit" name="photo_add" value="Add" /></p>
		</div>

</form><?

if (sizeof($d = dat('gallery'))) {
	foreach (dat('gallery') as $im => $info) { 

		?><div class="thumb" style="height:<?=$s['tnh'] + 36?>px">
			<a title='Edit image' class="button edit" href="edit-<?=$im?>/"><span>Edit</span></a>
			<a title='Kill image' class="button kill" href="delete-<?=$im?>/" onclick="return confirm('Are you sure you want to kill this image?')"><span>Kill</span></a><br />
			<a href="#" title="See full picture in a window" onclick="return showImage('<?="$s[path]$im"?>', '', <?=$info['w']?>, <?=$info['h']?>);">
				<img src="<?="$s[path]$info[tn]"?>" />
			</a>
			<div class="fn"><?=$im?></div>
		</div><?
	}

?><div class="clearer"></div>

<form action="" method="post" enctype="multipart/form-data">

		<div>
			<p><label>Add image (size: <?=$s[w]?> x <?=$s[h]?>)<br />
				<input type="file" name="image" class="wide" />
			</label></p>
			<p><input type="submit" name="photo_add" value="Add" /></p>
		</div>

</form><?

} ?>
